﻿app.factory('userService', function () {
    var userPhoto = 'userPicture';
    var username = 'username';
    return {
        getUsername: function () {
            var name = localStorage.getItem(username);
            if (name != undefined) {
                return name;
            }
            return null;
        },
        saveUsername: function (name) {
            localStorage.setItem(username, name);
            return name;
        },
        getUserPicture: function () {
            var photo = localStorage.getItem(userPhoto);
            if (photo != undefined) {
                return photo;
            }
            return null;
        },
        saveUserPicture: function (userPicture) {
            localStorage.setItem(userPhoto, userPicture);            
            return userPicture;
        },
    };
});
